Skip to content

Conversation

halx99
Copy link
Collaborator

@halx99 halx99 commented Feb 11, 2025

Describe your changes

Previous working PR #2204 was closed due to branch name renamed from 3.x to wip-v3

  • ISO c++23 standard
  • Texture resource improvment, add texture array support, remove CPU array implement since all graphics API support texture array
  • Remove sampler from Texture, implement texture sampler object and cache it, since GLES3/OGL-3.3, mtl, d3d support sampler object
  • Update lua to 5.5.x
  • Remove the default pixel format, fix rendering of grayscale PNGs by @j-jorge in Remove the default pixel format, fix rendering of grayscale PNGs #2573
  • Remove all deprecated stubs
  • Implement drawArraysInstanced and make instanced draw more common use
  • box2d-3.x
    • Make Box2dTest of cpp-tests works on box2d v3
    • Make Box2dTestBed of cpp-tests works on box2d v3
  • Remove chipmunk
    • Remove core/physics based on chipmunk
    • Remove ChipmunkTest from cpp-tests
    • Remove ChipmuniTestbed from cpp-tests
  • Improve DrawNode, don't create backend::Buffer always
  • Upgrade iOS deploy target: 12.0 => 13.0
  • Upgrade android minsdk: 17(Android 4.2) => 21(Android 5.1)
  • Upgrade android ndk: r23 => latest LTS release r27
  • Due to android,ios toolchain update to support c++20 full features, std::views::split can be use to improve performance
  • Remove 3rdparty ghc filesystem, since both ios13 and android5.1 support std::filesystem
  • Build and run wasm64 support, current need enable chrome flag: chrome://flags/#enable-webassembly-memory64
  • Color4B => Color32
  • Remove Color3B
  • Remove deprecated StringUtils::format
  • drop GLES 2.0 support since all Android 5.1+ devices support opengl-es-3.0
  • Improve axslcc preprocessors, remove METAL, GLES2, then add AXSLC_TARGET_[GLSL,HLSL,MSL,GLES]
  • Improve VertexLayout management
  • Improve sampler2D texs[4] support, 2.x only support OpenGL, now support all RHI: d3d11, metal, opengl(es)
  • Reimplement core/physics with box2d v3, not all API compatible with axmol-2.x (in-progress)
    • basic functionals
    • Rename PhysicsJointXXX::construct => PhysicsJointXXX::instantiate
    • b2ContactListener
  • re-select json lib: yyjson > boost.json > rapidjson
    simdjson for parse only and simdjson build in-progress: https://github.com/simdjson/experimental_json_builder
    finally solution: yyjson + simdjson
  • drop tolua, use sol2
  • Choose shader for more render objects like Sprite
    • ParticleSystemQuad

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@paulocoutinhox
Copy link
Contributor

Version 3 don't will be published with PhysicsBody replacement?

image

@halx99
Copy link
Collaborator Author

halx99 commented Feb 18, 2025

version 3 still in early status, and should contains physics2d when publish.

@halx99 halx99 changed the title working in-progress v3 Working in-progress v3 Feb 19, 2025
@paulocoutinhox
Copy link
Contributor

Will be nice if we have a single json library easy to use, like nlohmann/json instead of two.

@halx99 halx99 force-pushed the wip-v3 branch 3 times, most recently from 7b071d4 to c672b49 Compare February 24, 2025 15:19
@halx99
Copy link
Collaborator Author

halx99 commented Feb 24, 2025

Will be nice if we have a single json library easy to use, like nlohmann/json instead of two.

The nlohmann/json easy to use, but performance not good.

@halx99 halx99 added this to the 3.0.0 milestone Feb 24, 2025
@danialias
Copy link
Contributor

I need rapidjson performance as well, please do not remove 😅

@paulocoutinhox
Copy link
Contributor

I don't understand how a JSON lib in a game engine needs such an absurd performance, since things like that are used in few moments, like loading or saving things at specific times.

In our app (Ubook) that uses JSON all the time and processes thousands of JSON data with thousands of records, the processing is instantaneous, even in huge JSON data and we use nloman/json. Before we used rapid, but it doesn't have as many features, requiring other libs to be used and more things to be maintained, decreasing efficiency in exchange for NOTHING.

For me, it would make sense to keep a single lib that is easy to use and that for our scenario here at Axmol, will not affect anything in practice.

Here is my opinion based on my reality as someone who uses this in practice and in large volumes, both on Android and iOS, as well as on Apple Watch and Apple TV and also on the desktop.

@rh101
Copy link
Contributor

rh101 commented Feb 25, 2025

I need rapidjson performance as well, please do not remove 😅

If it is removed from Axmol, then you can easily add it into your own projects with a few lines of CMake code, and nothing else has to change in your projects.

@rh101
Copy link
Contributor

rh101 commented Feb 25, 2025

I don't understand how a JSON lib in a game engine needs such an absurd performance, since things like that are used in few moments, like loading or saving things at specific times.

Your projects may not require the speed of libraries like rapidjson, but that may not apply to projects by others, since they may have completely different requirements.

In our app (Ubook) that uses JSON all the time and processes thousands of JSON data with thousands of records, the processing is instantaneous, even in huge JSON data and we use nloman/json. Before we used rapid, but it doesn't have as many features, requiring other libs to be used and more things to be maintained, decreasing efficiency in exchange for NOTHING.

There are cases where the speed of parsing needs to be as quick as possible, such as in event handlers, comms response handlers, etc. etc.. In these cases, speed definitely does matter, and it is quite noticeable if the parsing takes too long.

For me, it would make sense to keep a single lib that is easy to use and that for our scenario here at Axmol, will not affect anything in practice.

That may be the case for your own projects, but again, it may not apply to projects by others. Also, just because a specific library works for you, it doesn't mean that it is appropriate for it to be used in Axmol.

Here is my opinion based on my reality as someone who uses this in practice and in large volumes, both on Android and iOS, as well as on Apple Watch and Apple TV and also on the desktop.

That's all well and good, and as you stated, your opinion is based on the requirements of your own projects, but it's not really appropriate to make statements about what other developer should or shouldn't use in their projects, because you really don't know what their requirements are.

The engine should bundle whatever json library (or libraries) it requires, but that in no way forces the developers using Axmol to also use those libraries. Developers are free to use whatever library they want to use.

On a side note, many developers who use Axmol for their released projects have never posted on this discussion board, and may not even read these threads, so unfortunately, it would be hard to get their feedback on such things.

@halx99
Copy link
Collaborator Author

halx99 commented Feb 25, 2025

Finally, maybe yyjson, speed fast and support read/write and dom style APIs, axmol can make a thin c++ wrapper

@iAndyHD3
Copy link
Contributor

iAndyHD3 commented Feb 25, 2025

The problem with nlohman/json is not only its lack of runtime speed but it's also a huge >10k thousand long header only library, making compilation also slower. its really one of the worst options you can choose. In modern C++ there is a clear new winner in my opinion: glaze is a modern C++ json library with automatic serialization/deserialization, making it really convenient for simple use cases. The performance is on par with simdjson. For non reflection uses, there is generic json which is similar to nlohman in that regard.

There are a few cons, thought:
it only supports c++23
Needs recent compiler versions
Not sure if it has been tested in platforms like wasm, ios

@paulocoutinhox
Copy link
Contributor

Hi,

Glaze is nice too. Their syntax is like nlohman/json and is easy to use.

My concern is always to keep the engine as easy as possible for people to use. It's better to use Glaze, which already does everything, than to have to adopt several libraries and increase complexity, lowering the barrier to entry.

@halx99
Copy link
Collaborator Author

halx99 commented Feb 25, 2025

I tried glaze, but compile fails
EDIT: seems it fix msvc compile issues recently

@halx99 halx99 force-pushed the wip-v3 branch 3 times, most recently from 8c3f108 to d46bafc Compare February 26, 2025 16:54
@halx99 halx99 force-pushed the wip-v3 branch 5 times, most recently from 395cff7 to ad0a279 Compare March 2, 2025 14:48
@halx99 halx99 force-pushed the wip-v3 branch 10 times, most recently from 0b8a844 to 8d559ff Compare August 17, 2025 05:08
@j-jorge
Copy link
Contributor

j-jorge commented Aug 19, 2025

I was wondering if v3 wouldn't be a good time for more breaking changes, like getting rid of the .h extension for the headers in favor of .hpp or something like this, such that we can finally know that it is C++ without opening the file. What do you think?

In the same vein, what do you think of enforcing the code formatting in the CI by running a clang-format check on each PR?

halx99 added 8 commits August 20, 2025 18:03
* [RHI] Add sampler2DArray support

* [RHI] Add sampler2DArray support, adpot mipmaps

* [RHI] Add sampler2DArray support, adpot RenderTexture

* [RHI] Add sampler2DArray support, adpot etc1 with alpha rendering

* [RHI] Add sampler2DArray support, adpot context loss recovery

* [RHI] Add sampler2DArray support, improve code style
The d3d11 will not fill missing a_position comp z,w like opengl, so need matched shader to render 2d nodes: ProgressTimer, MotionStreak, Grid, Texture2D
* Improve VertexLayout management

* Unify instance draw shader

* Update d3d shader compile inital optimize flag

* comment vertex input binding cache [skip ci]
* Re-add ProgramState setTextureArray feature and do improvement

* OMG, the d3d11 terrain rendering works as expected

And  previous revision does't work as expected due to texture binding slots incorrect

* Restore `ProgramState::setTextureArray`
* Improve Terrain rendering, use `uniform sampler2D u_details[4]` to store detailMap textures
* Improve  Terrain rendering,  set alphaMap, lightMap dummy texture RHI independent when they are not used
* Fix Terrain rendering doesn't work when use d3d11
* Fix vertex attribute binding cache incorrect
* Use macos-14 for ios ci due to unexpected compile error
* Upgrade MSL version: 1.2 => 2.0 (requires macos13 and ios 11+) for supporting texture array `sampler2D u_details[4]`
@halx99
Copy link
Collaborator Author

halx99 commented Aug 26, 2025

This PR is for ci check only, since we try to update branch mangement: enable ci for dev/, release/, this PR can closed, v3 roadmap, please see: #2650

@halx99
Copy link
Collaborator Author

halx99 commented Aug 26, 2025

I was wondering if v3 wouldn't be a good time for more breaking changes, like getting rid of the .h extension for the headers in favor of .hpp or something like this, such that we can finally know that it is C++ without opening the file. What do you think?

In the same vein, what do you think of enforcing the code formatting in the CI by running a clang-format check on each PR?

auto run clang-foramt check is a good idea.

@halx99 halx99 closed this Aug 26, 2025
@halx99 halx99 deleted the wip-v3 branch August 26, 2025 18:11
@halx99
Copy link
Collaborator Author

halx99 commented Aug 27, 2025

I was wondering if v3 wouldn't be a good time for more breaking changes, like getting rid of the .h extension for the headers in favor of .hpp or something like this, such that we can finally know that it is C++ without opening the file. What do you think?
In the same vein, what do you think of enforcing the code formatting in the CI by running a clang-format check on each PR?

auto run clang-foramt check is a good idea.

should finish by PR: #2654

@j-jorge
Copy link
Contributor

j-jorge commented Aug 27, 2025

If I understood #2654 correctly it creates a new commit which formats the code on each PR. This is imho a bad solutions as those commits will pollute the history with meaningless changes, complexifying git blame and git bisect, for example. Still imho, the pipeline should just check that the code is formatted, and let the committer rewrite its commits with adequately formatted code.

@halx99
Copy link
Collaborator Author

halx99 commented Aug 28, 2025

If I understood #2654 correctly it creates a new commit which formats the code on each PR. This is imho a bad solutions as those commits will pollute the history with meaningless changes, complexifying git blame and git bisect, for example. Still imho, the pipeline should just check that the code is formatted, and let the committer rewrite its commits with adequately formatted code.

at least, first time, we can format all sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants